package day16.晚间练习.组播;

import java.io.IOException;
import java.net.*;

public class ReceiveDemo {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds=new DatagramSocket(10001);
        byte[] bytes=new byte[1024];
        DatagramPacket dp=new DatagramPacket(bytes,bytes.length);
       ds.receive(dp);
        System.out.println("数据是"+new String(dp.getData(),0,dp.getLength()));

    }
}
